home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 3
/
Info_Mac_1994-01.iso
/
Development
/
General
/
SpriteWorld 1.0b3
/
Examples
/
SpaceRocks
/
Application.h
< prev
next >
Wrap
Text File
|
1993-05-23
|
3KB
|
105 lines
///--------------------------------------------------------------------------------------
// Application.h
//
// Created: Sunday, April 11, 1993
// By: Tony Myles
//
// Copyright: © 1993 Tony Myles, All rights reserved worldwide.
///--------------------------------------------------------------------------------------
#ifndef __APPLICATION__
#define __APPLICATION__
#ifndef __APPLEEVENTS__
#include <AppleEvents.h>
#endif
enum
{
kNumberOfMoreMastersCalls = 3
};
enum
{
kMenuBarResID = 128,
kWindowResID = 128
};
enum
{
kAppleMenuID = 128,
kFileMenuID = 129,
kEditMenuID = 130
};
enum
{
kAboutItem = 1,
kNewItem = 1,
kQuitItem = 3
};
enum
{
kForeGroundSleepTime = 0x7FFFFFFF,
kBackGroundSleepTime = 0x7FFFFFFF
};
enum
{
kErrorAlertResID = 128,
kCantRunAlertResID = 129,
kErrorStringListResID = 128,
kUnknownErrorStringIndex = 1,
kCantFindResourceStringIndex = 2
};
#define kSeriousDamageString "\pCould not even get error string!\rThis application is seriously damaged!"
#ifdef __cplusplus
extern "C" {
#endif
void main(void);
void Initialize(short numberOfMasters);
Boolean CheckSystem(void);
Boolean HasAppleEvents(void);
Boolean HasWaitNextEvent(void);
OSErr InstallAppleEventHandlers(void);
void CreateMenuBar(void);
void CreateWindow(void);
Boolean EnterApplication(void);
void ExitApplication(void);
void ServiceEvents(void);
void DispatchEvent(EventRecord* event);
void HandleMouseEvent(EventRecord* event);
void HandleKeyEvent(char key, short modifiers);
void HandleUpdateEvent(WindowPtr updateWindowP);
void HandleActivateEvent(WindowPtr updateWindowP);
void HandleOSEvent(long message);
void HandleDiskEvent(long message);
void HandleNullEvent(void);
void HandleMenuCommand(long menuItemIdentifier);
void HandleAppleMenuCommand(short menuItem);
void HandleFileMenuCommand(short menuItem);
void HandleEditMenuCommand(short menuItem);
pascal OSErr HandleOpenApp(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
pascal OSErr HandleOpenDoc(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
pascal OSErr HandlePrintDoc(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
pascal OSErr HandleQuit(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
void ErrorAlert(OSErr err, short errorStringIndex);
void CantFindResource(void);
void CantRunOnThisMachine(void);
short NumToolboxTraps(void);
TrapType GetTrapType(short trap);
Boolean TrapAvail(short trap);
#ifdef __cplusplus
};
#endif
#endif /* __APPLICATION__ */